<%@ page import="books4all.User" %>


<sec:ifNotLoggedIn>
<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'username', 'error')} required">
	<label for="username">
		<g:message code="user.username.label" default="Username" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="username" required="" value="${userInstance?.username}"/>
</div>
</sec:ifNotLoggedIn>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'password', 'error')} required">
	<label for="password">
		<g:message code="user.password.label" default="Password" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="password" required="" value=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'mail', 'error')} required">
	<label for="mail">
		<g:message code="user.mail.label" default="Mail" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="email" name="mail" required="" value="${userInstance?.mail}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'avatar', 'error')} ">
	<label for="avatar">
		<g:message code="user.avatar.label" default="Avatar" />
		
	</label>
	<g:select id="avatar" name="avatar.id" from="${userInstance?.images}" optionKey="id" value="${userInstance?.avatar?.nom}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'ddn', 'error')} ">
	<label for="ddn">
		<g:message code="user.ddn.label" default="Ddn" />
		
	</label>
	<g:datePicker name="ddn" precision="day"  value="${userInstance?.ddn}" default="none" noSelection="['': '']" />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'sexe', 'error')} ">
	<label for="sexe">
		<g:message code="user.sexe.label" default="Sexe" />
		
	</label>
	<g:select name="sexe" from="${userInstance.constraints.sexe.inList}" value="${userInstance?.sexe}" valueMessagePrefix="user.sexe" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'biblio', 'error')} " style="display:none; visibility:hidden">
	<label for="biblio">
		<g:message code="user.biblio.label" default="Biblio" />
		
	</label>
	<g:select name="biblio" from="${books4all.Livre.list()}" multiple="multiple" optionKey="id" size="5" value="${userInstance?.biblio*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'amis', 'error')} "style="display:none; visibility:hidden">
	<label for="amis">
		<g:message code="user.amis.label" default="Amis" />
		
	</label>
	<g:select name="amis" from="${books4all.User.list()}" multiple="multiple" optionKey="id" size="5" value="${userInstance?.amis*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'images', 'error')} " style="display:none; visibility:hidden">
	<label for="images">
		<g:message code="user.images.label" default="Images" />
		
	</label>
	<g:select name="images" from="${books4all.Image.list()}" multiple="multiple" optionKey="id" size="5" value="${userInstance?.images*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'accountExpired', 'error')} " style="display:none; visibility:hidden">
	<label for="accountExpired">
		<g:message code="user.accountExpired.label" default="Account Expired" />
		
	</label>
	<g:checkBox name="accountExpired" value="${userInstance?.accountExpired}" />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'accountLocked', 'error')} " style="display:none; visibility:hidden">
	<label for="accountLocked">
		<g:message code="user.accountLocked.label" default="Account Locked" />
		
	</label>
	<g:checkBox name="accountLocked" value="${userInstance?.accountLocked}" />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'enabled', 'error')} " style="display:none; visibility:hidden">
	<label for="enabled">
		<g:message code="user.enabled.label" default="Enabled" />
		
	</label>
	<g:checkBox name="enabled" value="${userInstance?.enabled}" />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'passwordExpired', 'error')} " style="visibility:hidden">
	<label for="passwordExpired">
		<g:message code="user.passwordExpired.label" default="Password Expired" />
		
	</label>
	<g:checkBox name="passwordExpired" value="${userInstance?.passwordExpired}" />
</div>

